const express = require("express");

const { query } = require("../conn/conn");

const router = express.Router();


router.get("/getLt", async (req, res, next) => {
  let sql = "select * from product";

  let result = await query(sql); // 查询数据

  // console.log(result);
  // console.log(data);
  res.send(result); // 响应数据
});
router.get("/getItem", async (req, res, next) => {
  let { id } = req.query;

  // console.log(req.query);

  let sql = `select * from product where id=${id}`;

  let result = await query(sql);

  res.send(result);
});
module.exports = router;

